<?php
    @session_start();
    $x = new Zend_Auth_Storage_Session('User_Auth');
    $y = $x->read();
    $front = Zend_Controller_Front::getInstance();
    $email_address = $front->getRequest()->getParam('email');
    $user_id = $front->getRequest()->getParam('user_id');
    $pswa = $front->getRequest()->getParam('pswa');
    $activate = $front->getRequest()->getParam('activate');

    if (isset($_SESSION['connect']))
        $connect = $_SESSION['connect'];
    else
        $connect = 'off';

    $step = $this->step;

    if (empty($step))
        $step = 1;

    if (!empty($email_address))
    {
        $step = $front->getRequest()->getParam('step');
    }

    $extra = false;
    if (!empty($user_id) && !empty($pswa))
    {
        $extra = array();
        $extra['user_id'] = $user_id;
        $extra['pswa'] = $pswa;
    }

    if (!empty($user_id) && !empty($activate))
    {
        $extra = array();
        $extra['user_id'] = $user_id;
        $extra['activate'] = $activate;
        $step = "4";
    }

    $shopArr = $this->getHelper('Navi')->getShopMenu();
    $loginForm = $this->getHelper('NavForm')->loginForm($step, (!empty($email_address) ? $email_address : $this->signupemail), $extra);
//prd($shopArr);
?><div id="header" class="row-fluid clearfix">
    <ul class="pull-left">
        <li class="orange-line">
            <a href="<?php echo APPLICATION_URL; ?>"><img src="<?php echo IMAGES_PATH; ?>/logo.png" alt="logo" class="logo"/></a>
        </li><!--        <li>
            <a href="#" id="header-search-btn" rel="no-cross"><img src="<?php echo IMAGES_PATH; ?>/search-icon.png" alt="search"/></a>
        </li>--><li class="orange-line">
            <a href="<?php echo APPLICATION_URL; ?>/product/all">SHOP</a>
            <ul class="sub">
                <!--<p class="orange-bar"></p>-->
                <div class="">
                    <?php
                        $__counter = 0;
                        foreach ($shopArr as $catKey => $catVal)
                        {
                            //prd($catVal);
                            ?>
                            <p class="heading <?php echo $__counter > 0 ? 'margin-top-20' : ''; ?>"><?php echo $catKey; ?></p>
                            <div>
                                <?php
                                foreach ($catVal as $subKey => $subVal)
                                {
                                    //prd($subKey);
                                    ?>
                                    <p><a  style="color:#000;" href="<?php echo APPLICATION_URL ?>/product/all?s=<?php echo $subVal['scat_id']; ?>"><?php echo $subVal['scat_name']; ?></a></p>
                                    <?php
                                }
                                ?>
                            </div>                            

                            <?php
                            $__counter++;
                        }
                    ?>
                </div>
                <div class="">
                    <p class="heading">Featured</p>
                    <img src="<?php echo IMAGES_PATH; ?>/navbar-girl.jpg" alt="image" style="width: 160px;"/>
                </div>
            </ul>

        </li><!--
        --> 
        <!--<li>
                    <a href="trends.php">TRENDING</a>
                    <ul class="sub trending-sub">
                        <p class="orange-bar"></p>
                        <div class="">
                            <p class="heading">Products</p>
        
                            <div>
        
                                <p>Clothes</p>
                                <p>Dresses</p>
                                <p>Tops</p>
                                <p>Rompers + Jumpsuits</p>
                                <p>Swimwear</p>
                                <p>Lingerie</p>
                                <p>Jackets &amp; Coats</p>
                                <p>Sweaters</p>
        
                                <p class="social-feed-heading">Social Feed</p>
                                <p>Facebook</p>
                                <p>Twitter</p>
                                <p>Instagram</p>
        
                            </div>                            
                        </div>
        
                        <div class="">
                            <p class="heading">Hot Trends</p>
                            <img src="<?php echo IMAGES_PATH; ?>/navbar-girl.jpg" alt="image"/>
                        </div>
        
                    </ul>
                </li>-->
        <!--
        --><li class="orange-line">
            <a href="<?php echo APPLICATION_URL ?>/brand/all">BRAND</a>
        </li><!--
        --><li class="orange-line">
            <a href="http://blog.raeken.com">BLOG</a>
        </li><!--
        --><li class="connect hoverNoBackground">
            <p>Connect</p>
            <a href="#" id="connect-switch" rel="red"><img src="<?php echo IMAGES_PATH . "/" . ($connect == 'off' ? 'connect-red.png' : 'connect-green.png'); ?>" alt="image"/></a>
        </li>
    </ul>

    <ul class="pull-right" style="position: relative;">
        <?php
            if (empty($y))
            {
                ?>
                <li><a href="#" class="colorbox-html-signup">Join Now</a>&nbsp;|&nbsp;<a id="login-link" href="<?php echo APPLICATION_URL ?>/index/login">Sign In</a></li>
                <?php
            }
            else
            {
                ?>

                <li class="dropdown">
                    <!--<a data-toggle="dropdown" class="dropdown-toggle" id="myaccount-dropdown" href="#">My account</a>-->
                    <a  id="myaccount-dropdown" href="<?php echo APPLICATION_URL ?>/myaccount">My account</a>
<!--                    <ul class="dropdown-menu" role="menu" aria-labelledby="myaccount-dropdown">
                        <li><a style="color:#000;" href="<?php echo APPLICATION_URL ?>/index/logout">Sign out</a></li>
                    </ul>-->
                    &nbsp;|&nbsp;<a href="<?php echo APPLICATION_URL ?>/cart" class="color-orange">Cart</a></li>
                <li class="noborder cart-items-count-header display-cart-box">0</li>
                <p class="cart-items-count-header-small-line-below"></p>
                <?php
            }
        ?>
    </ul>

    <div class="cart-content-header-onhover hide">
        <p class="inline-block text">Your Cart is Empty</p>
        <p class="inline-block text-with-orange-background"><span>0</span> Item(s)</p>
        <hr/>
        <p class="text-center color-black">Get free shipping on order of $80+</p>
    </div>
</div>
<?php
    if (empty($y))
    {
        ?>
        <script type="text/javascript">
            $(document).ready(function(){
                                     
                                                            

        <?php
        if (($this->step == '1' || empty($this->step) ) && $step != 2 && $step != 3)
        {
            ?>
                        $('.colorbox-html-signup').click(function(){
                            $.colorbox({
                                html: '<?php echo preg_replace('/(?:\s\s+|\n|\t)/', ' ', $loginForm); ?>',
                                width: "553px",
                                height: "445px",
                                scrolling:false,
                                closeButton:true
                            });
                                                                                                        
                            validateForm();
                                                                                                        
                        });
                                                                                                           
            <?php
        }
        else
        {
            ?>
                        $('.colorbox-html-signup').click(function(){
                                                            
                            $.colorbox({
                                html: '<?php echo preg_replace('/(?:\s\s+|\n|\t)/', ' ', $loginForm); ?>',
                                width: "553px",
                                //                        height:'100%',
                                scrolling:false,
                                closeButton:true
                            });
                                                            
                        });
                                                        
                        $.colorbox({
                            html: '<?php echo preg_replace('/(?:\s\s+|\n|\t)/', ' ', $loginForm); ?>',
                            width: "553px",
                            //                        height:'100%',
                            scrolling:false,
                            closeButton:true
                        });
                                            
            <?php
        }
        ?>
            });
        </script>
        <?php
    }
    else
    {

        if ($step == 4)
        {
            ?>
            <script type="text/javascript">
                $(document).ready(function(){
                    $.colorbox({
                        html: '<?php echo preg_replace('/(?:\s\s+|\n|\t)/', ' ', $loginForm); ?>',
                        width: "553px",
                        //                        height:'100%',
                        scrolling:false,
                        closeButton:true
                    });
                                             
                });
            </script>

            <?php
        }
    }
?>
        
